package com.fingard.dsp.bank.reqrespobj.elecbillquery;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.elecbillquery.detail.RetAtsB010ProtocolStateQryDetail;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by F on 2019/5/26.
 */
public class RetAtsB010ProtocolStateQry extends RetAtsBase {
    public String respCode;
    public String respInfo;
    public String protocolNo;
    public String reqSeqID;
    public String transState;
    public String payInfoCode;

    public RetAtsB010ProtocolStateQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }


    public void writeBefore() {
        retXmlWriter.writeElementString("RespCode",respCode);
        retXmlWriter.writeElementString("RespInfo",respInfo);
        retXmlWriter.writeElementString("ProtocolNo",protocolNo);
        retXmlWriter.writeElementString("ReqSeqID",reqSeqID);
        retXmlWriter.writeElementString("TransState",transState);
        retXmlWriter.writeElementString("PayInfoCode",payInfoCode);
    }

    public void writeAfter() {
        writeEnd();
    }

    public void writeDetail(RetAtsB010ProtocolStateQryDetail DB010Detail) {
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("BillNo",DB010Detail.billNo);
        retXmlWriter.writeElementString("BillNum",DB010Detail.billNum);
        retXmlWriter.writeElementString("BillType",DB010Detail.billType);
        retXmlWriter.writeElementString("IssDate",DB010Detail.issDate);
        retXmlWriter.writeElementString("DueDate",DB010Detail.dueDate);
        retXmlWriter.writeElementString("BillAmt",DB010Detail.billAmt);
        retXmlWriter.writeElementString("TransFlag",DB010Detail.transFlag);
        retXmlWriter.writeElementString("MustPay",DB010Detail.mustPay);
        retXmlWriter.writeElementString("DrawName",DB010Detail.drawName);
        retXmlWriter.writeElementString("DrawAct",DB010Detail.drawAct);
        retXmlWriter.writeElementString("DrawBnkName",DB010Detail.drawBnkName);
        retXmlWriter.writeElementString("DrawBnkCode",DB010Detail.drawBnkCode);
        retXmlWriter.writeElementString("AccpName",DB010Detail.accpName);
        retXmlWriter.writeElementString("AccpAct",DB010Detail.accpAct);
        retXmlWriter.writeElementString("AccpBnkName",DB010Detail.accpBnkName);
        retXmlWriter.writeElementString("AccpBnkCode",DB010Detail.accpBnkCode);
        retXmlWriter.writeElementString("PayeeName",DB010Detail.payeeName);
        retXmlWriter.writeElementString("PayeeAct",DB010Detail.payeeAct);
        retXmlWriter.writeElementString("PayeeBnkName",DB010Detail.payeeBnkName);
        retXmlWriter.writeElementString("PayeeBnkCode",DB010Detail.payeeBnkCode);
        retXmlWriter.writeElementString("BillState",DB010Detail.billState);
        retXmlWriter.writeElementString("Result",DB010Detail.result);
        retXmlWriter.writeElementString("PayInfoCode",DB010Detail.payInfoCode);
        retXmlWriter.writeElementString("PostScript",DB010Detail.reqSeqId);
        retXmlWriter.writeEndElement();
    }
}
